export const get_perm = (name) => {
  let url;
  let local = localStorage.getItem("permission");
  // lead 领导
  // manage 分总 manageArea区总
  // bd bd&bdm
  switch (name) {
    case "busineslist":
      // 公海
      if (local === "lead") {
        url = "/business/open_sea/get/list/lead";
      } else if (local === "manage" || local === "manageArea") {
        url = "/business/open_sea/get/list/manage";
      } else {
        url = "/business/open_sea/get/list/bd";
      }
      break;
    case "silenceSea":
      // 沉寂库
      if (local === "lead") {
        url = "/business/silence_sea/get/list/lead";
      } else if (local === "manage" || local === "manageArea") {
        url = "/business/silence_sea/get/list/manage";
      }
      break;
    case "tempSea":
      // 临时库
      if (local === "bd") {
        url = "/business/temp_sea/get/list/bd";
      } else if (local === "manage" || local === "manageArea") {
        url = "/business/temp_sea/get/list/manage";
      } else if (local === "lead") {
        url = "/business/temp_sea/get/list/lead";
      }
      break;
    case "private_sea":
      // 私海
      if (local === "bd") {
        url = "/business/private_sea/get/list/bd";
      } else if (local === "manage" || local === "manageArea") {
        url = "/business/private_sea/get/list/manage";
      } else if (local === "lead") {
        url = "/business/private_sea/get/list/lead";
      }
      break;
    case "out_business":
      // 外区商机列表
      if (local === "lead") {
        url = "/business/out/get/list/lead";
      } else if (local === "manage" || local === "manageArea") {
        url = "/business/out/get/list/manage";
      }
      break;
    case "fetchBusiness":
      // 搜索 商机搜索
      if (local === "lead") {
        url = "/business/search/lead";
      } else if (local === "manage" || local === "manageArea") {
        url = "/business/search/manage";
      } else {
        url = "/business/search/bd";
      }
      break;
  }
  return url;
};
